package com.dudsbury.jtablestuff;
import java.awt.Dimension;
import java.util.Vector;

import javax.swing.JTable;
import javax.swing.LookAndFeel;
import javax.swing.table.DefaultTableModel;

import com.dudsbury.database.MyRoom;

//Rooms on the left
public class RowHeaders extends JTable {
	
	public RowHeaders(MyRoom[] data,JTable table) {
		DefaultTableModel model = new DefaultTableModel(0,1);
		
		for (MyRoom s: data) {
			model.addRow(new Object[] {s});
	}
		//model.addRow( new Object[] { "a","b","c"});
		
		this.setModel(model);
		
		 LookAndFeel.installColorsAndFont
         (this, "TableHeader.background", 
         "TableHeader.foreground", "TableHeader.font");
		 Dimension d = this.getPreferredScrollableViewportSize();
		 
		 
		 setIntercellSpacing(new Dimension(0, 0));
		 d.width = this.getPreferredSize().width;
		 this.setPreferredScrollableViewportSize(d);
		 this.setRowHeight(table.getRowHeight());
		 this.setDefaultRenderer(Object.class, new RowHeaderRenderer());
		 
	}
	
	
	

}
